#!/bin/bash
docker-compose up -d
master='redis1-master'
passwd='fang'
cluster=(172.19.0.2 172.19.0.4 172.19.0.6 172.19.0.3 172.19.0.5 172.19.0.7)
cmd="redis-cli -a $passwd --cluster create "

for c in ${cluster[@]};do
	cmd+=$c":6379 "
done
cmd+="--cluster-replicas 1" 

docker exec -it $master sh -c "$cmd"
